//统一管理模块借口
import request from '@/utils/request'
//ts类型限制
import { HospitalInfo, HospitalResponseData } from './type'
import { HOSPITALLEVELANDREGIONResponse } from './type'
//通过枚举管理首页模块管理地址
enum API {
    //获取已有医院接口
    HOSPITAL_URL = '/hosp/hospital/',
    //获取已有等级和地区接口
    HOSPITALLEVELANDREGION = '/cmn/dict/findByDictCode/',
    //根据搜索获取医院名字
    HOSPITALGETNAME = '/hosp/hospital/findByHosname/',
    //获取证件的类型的接口地址
    CERTIFICATIONTYPE_URL = '/cmn/dict/findByDictCode/',
    //用户认证的结构
    USERCERTATION_URL = '/user/auth/userAuah',
    //获取用户订单号的数据
    USERORDERINFO_URL = '/order/orderInfo/auth/',
    //获取全部就诊人的信息
    ALLUSER_URL = '/user/patient/auth/findAll',
    //获取订单的状态
    ORDERSTATE_URL = '/order/orderInfo/auth/getStatusList',
    //获取城市的数据
    CITY_URL = '/cmn/dict/findByParentId/',
    //新增就诊人接口
    ADDUSER_URL = '/user/patient/auth/save',
    //更新已有的就诊人接口
    UPDATEUSER_URL = '/user/patient/auth/update',
    //删除已有的就诊人
    DELETEUSER_URL = '/user/patient/auth/remove/'

}
//获取医院数据
export const reqHospital = (page: number, limit: number, hostype = '', districtCode = '') => {
    return request.get<any, HospitalResponseData>(API.HOSPITAL_URL + `${page}/${limit}?hostype=${hostype}&districtCode=${districtCode}`)
}
//获取医院等级或者地区数据
export const reqhospitalLevelRegion = (dictCode: string) => {
    return request.get<any, HOSPITALLEVELANDREGIONResponse>(API.HOSPITALLEVELANDREGION + dictCode)
}
//获取搜索得到的医院名字
export const reqHospitalGetNAme = (hosname: string) => {
    return request.get<any, HospitalInfo>(API.HOSPITALGETNAME + hosname)
}